package com.xkdx.guangguang.presistence.uploadhead;

import java.io.File;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

import org.apache.http.entity.mime.content.FileBody;

import android.os.Environment;

import com.xkdx.guangguang.module.network.AbsAction;

public class UploadHeadAction extends AbsAction {
	String userID, loginToken;

	public UploadHeadAction(String userID, String loginToken) {
		this.userID = userID;
		this.loginToken = loginToken;
		key=2;
		fileBody = new FileBody(new File(Environment.getExternalStorageDirectory() + "/GuangGuang/user/head.jpg"));
	}

	@Override
	public void constructRequest() {
		HashMap<String, String> map = new HashMap<String, String>();
		map.put("UserID", userID);
		map.put("LoginToken", loginToken);
		String json = constructJson(map);
		Parameter parameter = new Parameter("userInterface", "editUserPicture", json);

		List<Parameter> list = new ArrayList<Parameter>();
		list.add(parameter);
		requestData = constructMod(list);

	}

}
